package com.powernode.ssm.config;

import com.powernode.ssm.service.RedisService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * 用来给静态工具类获取配置参数
 */
@Component
public class AppProperties {

    private static String appEncryptKey;
    private static String appCode;

    @Value("${myapp.encryptKey}")
    private String encryptKey;

    @Value("${myapp.code}")
    private String code;

    @PostConstruct
    public void init() {
        appEncryptKey = this.encryptKey;
        appCode = code;
    }

    public static String getAppEncryptKey() {
        return appEncryptKey;
    }

    public static String getAppCode() {
        return appCode;
    }
}
